﻿using System;
using System.Collections.Generic;
using System.Linq;

using System.Data;

using Recon.Portal.DataObjects;
using Recon.Portal.Data;

namespace Recon.Portal.Business
{
    public class Lists
    {
        #region: Public Constructor
        public Lists()
        {

        }
        #endregion

        #region Public Methods
        public List<Customer> GetCustomerList()
        {
            DBFactory db = new DBFactory();
            return db.GetAllCustomers();
        }
        
        public List<Invoice> GetUnmatchedInvoices(string CustomerID, string RemitterID, int MinDays, int MaxDays)
        {
            DBFactory db = new DBFactory();
            return db.GetUnmatchedInvoices(CustomerID, RemitterID, MinDays, MaxDays);
        }

        public List<Invoice> GetInvoicesForAmendment(string CustomerID, string RemitterId)
        {
            DBFactory db = new DBFactory();
            return db.GetInvoicesForAmendment(CustomerID, RemitterId);
        }
        public int DeleteInvoice(string ID)
        {
            DBFactory db = new DBFactory();
            return db.DeleteInvoice(ID);
        }
        public int DeleteStatement(string ID)
        {
            DBFactory db = new DBFactory();
            return db.DeleteStatement(ID);
        }

        public List<Invoice> GetUnmatchedInvoicesForRemitter(string CustomerID, string UserID)
        {
            DBFactory db = new DBFactory();
            return db.GetUnmatchedInvoicesForRemitter(CustomerID, UserID);
        }

        public List<Statement> GetUnmatchedStatements(string CustomerID)
        {
            DBFactory db = new DBFactory();
            return db.GetUnmatchedStatements(CustomerID);
        }
        public List<Statement> GetUnmatchedStatementsForRemitter(string CustomerID,string RemitterID,string Ref)
        {
            DBFactory db = new DBFactory();
            return db.GetUnmatchedStatementsForRemitter(CustomerID,RemitterID,Ref);
        }

        public List<MatchedInvoice> GetUnauthorizedInvoices(string CustomerID)
        {
            DBFactory db = new DBFactory();
            return db.GetUnauthorizedInvoices(CustomerID);
        }

        public List<string> GetAutoSequenceForMatchInvoice(string CustomerId, string RemitterId)
        {
            DBFactory db = new DBFactory();
            return db.GetAutoSequenceForMatchInvoice(CustomerId, RemitterId);
        }

        public DataTable GetReportData(ReportSearchCriteria criteria)
        {
            DBFactory db = new DBFactory();
            return db.GetReportData(criteria);
        }

        #endregion
    }
}